<<<<<<< HEAD:first homework/f22011219-郭欣/Duck.java
package com.example.Lib;
=======
package com.example.f22011226;
>>>>>>> 9847e549d509add37aeccd03e626d0f7a5d9ad62:first homework/f22011226_卢鸣宇/Duck.java

public abstract class Duck {
    FlyBehavior flyBehavior;
    Quackbehavior quackBehavior;

    public void performQuack() {

        quackBehavior.quack();
    }
    public void performFly() {
        flyBehavior.fly();
    }

    public abstract void display();

    public void swim() {
        System.out.println("I can swim");
    }

    public void setFlyBehavior(FlyBehavior flyBehavior) {
        this.flyBehavior = flyBehavior;
    }

    public void setQuackBehavior(Quackbehavior quackBehavior) {
        this.quackBehavior = quackBehavior;
    }

}

